import {fetch} from '@react-native-community/netinfo';

export const showToast = info => {
  global.Toast.show(info);
};

/**
 * show loading
 */
export const showLoading = () => {
  global.Loading.show();
};

/**
 * hide loading
 */
export const hideLoading = () => {
  global.Loading.hide();
};

/**
 * 判断网络是否可用
 */
export const isNetConnected = async () => {
  const netInfo = await fetch();
  return netInfo.isConnected;
};
